module.exports = (sequelize, DataTypes) => {
  const { STRING, DATE, NOW } = DataTypes;

  const User = sequelize.define("users", {
    id: {
      field: "id",
      type: STRING(30),
      comment: "用户工号",
      primaryKey: true,
      unique: true,
    },
    name: {
      field: "name",
      type: STRING(255),
      comment: "用户姓名",
    },
    createdAt: {
      field: "created_at",
      type: DATE,
      comment: "创建时间",
      defaultValue: NOW,
    },
    updatedAt: {
      field: "updated_at",
      type: DATE,
      comment: "更新时间",
      defaultValue: NOW,
    },
  });
  return User;
};
